📄 attributefactory.java
字号:
*
* @throws IllegalArgumentException if the given id is already in use
*/
public static void addAttributeProxy(String id, AttributeProxy proxy) {
getInstance().addDatatype(id, proxy);
}
/**
* Returns the datatype identifiers supported by this factory.
*
* @return a <code>Set</code> of <code>String</code>s
*/
public abstract Set getSupportedDatatypes();
/**
* Creates a value based on the given DOM root node. The type of the
* attribute is assumed to be present in the node as an XAML attribute
* named <code>DataType</code>, as is the case with the
* AttributeValueType in the policy schema. The value is assumed to be
* the first child of this node.
*
* @param root the DOM root of an attribute value
*
* @return a new <code>AttributeValue</code>
*
* @throws UnknownIdentifierException if the type in the node isn't
* known to the factory
* @throws ParsingException if the node is invalid or can't be parsed
* by the appropriate proxy
*/
public abstract AttributeValue createValue(Node root)
throws UnknownIdentifierException, ParsingException;
/**
* Creates a value based on the given DOM root node. The type of the
* attribute is assumed to be present in the node as an XAML attribute
* named <code>DataType</code>, as is the case with the
* AttributeValueType in the policy schema. The value is assumed to be
* the first child of this node. This uses the default factory.
*
* @deprecated As of version 1.2, replaced by
* {@link #createValue(Node)}.
* The new factory system requires you to get a factory
* instance and then call the non-static methods on that
* factory. The static versions of these methods have been
* left in for now, but are slower and will be removed in
* a future version.
*
* @param root the DOM root of an attribute value
*
* @return a new <code>AttributeValue</code>
*
* @throws UnknownIdentifierException if the type in the node isn't
* known to the factory
* @throws ParsingException if the node is invalid or can't be parsed
* by the appropriate proxy
*/
public static AttributeValue createAttribute(Node root)
throws UnknownIdentifierException, ParsingException
{
return getInstance().createValue(root);
}
/**
* Creates a value based on the given DOM root node and data type.
*
* @param root the DOM root of an attribute value
* @param dataType the type of the attribute
*
* @return a new <code>AttributeValue</code>
*
* @throws UnknownIdentifierException if the data type isn't known to
* the factory
* @throws ParsingException if the node is invalid or can't be parsed
* by the appropriate proxy
*/
public abstract AttributeValue createValue(Node root, URI dataType)
throws UnknownIdentifierException, ParsingException;
/**
* Creates a value based on the given DOM root node and data type. This
* uses the default factory.
*
* @deprecated As of version 1.2, replaced by
* {@link #createValue(Node,URI)}.
* The new factory system requires you to get a factory
* instance and then call the non-static methods on that
* factory. The static versions of these methods have been
* left in for now, but are slower and will be removed in
* a future version.
*
* @param root the DOM root of an attribute value
* @param dataType the type of the attribute
*
* @return a new <code>AttributeValue</code>
*
* @throws UnknownIdentifierException if the data type isn't known to
* the factory
* @throws ParsingException if the node is invalid or can't be parsed
* by the appropriate proxy
*/
public static AttributeValue createAttribute(Node root, URI dataType)
throws UnknownIdentifierException, ParsingException
{
return getInstance().createValue(root, dataType);
}
/**
* Creates a value based on the given DOM root node and data type.
*
* @param root the DOM root of an attribute value
* @param type the type of the attribute
*
* @return a new <code>AttributeValue</code>
*
* @throws UnknownIdentifierException if the type isn't known to
* the factory
* @throws ParsingException if the node is invalid or can't be parsed
* by the appropriate proxy
*/
public abstract AttributeValue createValue(Node root, String type)
throws UnknownIdentifierException, ParsingException;
/**
* Creates a value based on the given DOM root node and data type. This
* uses the default factory.
*
* @deprecated As of version 1.2, replaced by
* {@link #createValue(Node,String)}.
* The new factory system requires you to get a factory
* instance and then call the non-static methods on that
* factory. The static versions of these methods have been
* left in for now, but are slower and will be removed in
* a future version.
*
* @param root the DOM root of an attribute value
* @param type the type of the attribute
*
* @return a new <code>AttributeValue</code>
*
* @throws UnknownIdentifierException if the type isn't known to
* the factory
* @throws ParsingException if the node is invalid or can't be parsed
* by the appropriate proxy
*/
public static AttributeValue createAttribute(Node root, String type)
throws UnknownIdentifierException, ParsingException
{
return getInstance().createValue(root, type);
}
/**
* Creates a value based on the given data type and text-encoded value.
* Used primarily by code that does an XPath query to get an
* attribute value, and then needs to turn the resulting value into
* an Attribute class.
*
* @param dataType the type of the attribute
* @param value the text-encoded representation of an attribute's value
*
* @return a new <code>AttributeValue</code>
*
* @throws UnknownIdentifierException if the data type isn't known to
* the factory
* @throws ParsingException if the text is invalid or can't be parsed
* by the appropriate proxy
*/
public abstract AttributeValue createValue(URI dataType, String value)
throws UnknownIdentifierException, ParsingException;
/**
* Creates a value based on the given data type and text-encoded value.
* Used primarily by code that does an XPath query to get an
* attribute value, and then needs to turn the resulting value into
* an Attribute class. This uses the default factory.
*
* @deprecated As of version 1.2, replaced by
* {@link #createValue(URI,String)}.
* The new factory system requires you to get a factory
* instance and then call the non-static methods on that
* factory. The static versions of these methods have been
* left in for now, but are slower and will be removed in
* a future version.
*
* @param dataType the type of the attribute
* @param value the text-encoded representation of an attribute's value
*
* @return a new <code>AttributeValue</code>
*
* @throws UnknownIdentifierException if the data type isn't known to
* the factory
* @throws ParsingException if the text is invalid or can't be parsed
* by the appropriate proxy
*/
public static AttributeValue createAttribute(URI dataType, String value)
throws UnknownIdentifierException, ParsingException
{
return getInstance().createValue(dataType, value);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -