@Override public IOpenElementTag createOpenElementTag(final String elementName, final Map<String, String> attributes, final AttributeValueQuotes attributeValueQuotes, final boolean synthetic) { final ElementDefinition elementDefinition = this.elementDefinitions.forName(this.templateMode, elementName); final Attributes attributesObj = buildAttributes(buildAttributeArray(attributes, attributeValueQuotes)); return new OpenElementTag(this.templateMode, elementDefinition, elementName, attributesObj, synthetic); }
@Override public IStandaloneElementTag createStandaloneElementTag(final String elementName, final Map<String, String> attributes, final AttributeValueQuotes attributeValueQuotes, final boolean synthetic, final boolean minimized) { final ElementDefinition elementDefinition = this.elementDefinitions.forName(this.templateMode, elementName); final Attributes attributesObj = buildAttributes(buildAttributeArray(attributes, attributeValueQuotes)); return new StandaloneElementTag(this.templateMode, elementDefinition, elementName, attributesObj, synthetic, minimized); }
@Override public IOpenElementTag createOpenElementTag(final String elementName, final String attributeName, final String attributeValue, final boolean synthetic) { final ElementDefinition elementDefinition = this.elementDefinitions.forName(this.templateMode, elementName); final Attributes attributes = buildAttributes(new Attribute[] { buildAttribute(attributeName, attributeValue, null) }); return new OpenElementTag(this.templateMode, elementDefinition, elementName, attributes, synthetic); }
@Override public IStandaloneElementTag createStandaloneElementTag(final String elementName, final String attributeName, final String attributeValue, final boolean synthetic, final boolean minimized) { final ElementDefinition elementDefinition = this.elementDefinitions.forName(this.templateMode, elementName); final Attributes attributes = buildAttributes(new Attribute[] { buildAttribute(attributeName, attributeValue, null) }); return new StandaloneElementTag(this.templateMode, elementDefinition, elementName, attributes, synthetic, minimized); }
private IStandaloneElementTag removeAttribute(final IStandaloneElementTag standaloneElementTag, final AttributeName attributeName) { if (!(standaloneElementTag instanceof StandaloneElementTag)) { return removeAttribute(StandaloneElementTag.asEngineStandaloneElementTag(standaloneElementTag), attributeName); } return ((StandaloneElementTag) standaloneElementTag).removeAttribute(attributeName); }
private IOpenElementTag removeAttribute(final IOpenElementTag openElementTag, final String prefix, final String name) { if (!(openElementTag instanceof OpenElementTag)) { return removeAttribute(OpenElementTag.asEngineOpenElementTag(openElementTag), prefix, name); } return ((OpenElementTag) openElementTag).removeAttribute(prefix, name); }
private IStandaloneElementTag setAttribute(final IStandaloneElementTag standaloneElementTag, final String attributeName, final String attributeValue, final AttributeValueQuotes attributeValueQuotes) { if (!(standaloneElementTag instanceof StandaloneElementTag)) { return setAttribute(StandaloneElementTag.asEngineStandaloneElementTag(standaloneElementTag), attributeName, attributeValue, attributeValueQuotes); } return ((StandaloneElementTag) standaloneElementTag).setAttribute(this.attributeDefinitions, null, attributeName, attributeValue, attributeValueQuotes); }
StandaloneElementTag removeAttribute(final String completeName) { final Attributes oldAttributes = (this.attributes != null? this.attributes : Attributes.EMPTY_ATTRIBUTES); final Attributes newAttributes = oldAttributes.removeAttribute(this.templateMode, completeName); if (oldAttributes == newAttributes) { return this; } return new StandaloneElementTag(this.templateMode, this.elementDefinition, this.elementCompleteName, newAttributes, this.synthetic, this.minimized, this.templateName, this.line, this.col); }
@Override public ProcessorExecutionVars initializeProcessorExecutionVars() { // This will be called once per iteration, so we need to clone it every time it is requested return super.initializeProcessorExecutionVars().cloneVars(); }
public boolean isStopped() throws IOException { if (this.flushable) { // We need this flushing because OutputStreamWriter bufferizes, and given we might be taking account of // the output bytes at an OutputStream implementation in a level below this OutputStreamWriter, we could // have the wrong figures until we flush contents. this.flush(); this.flushable = false; } return this.adapter.isStopped(); }
public static boolean isWhitespace(final IText text) { if (text == null) { return false; } if (text instanceof Text) { return ((Text) text).isWhitespace(); } return computeWhitespace(text); }
OpenElementTag setAttribute( final AttributeDefinitions attributeDefinitions, final AttributeDefinition attributeDefinition, final String completeName, final String value, final AttributeValueQuotes valueQuotes) { final Attributes oldAttributes = (this.attributes != null? this.attributes : Attributes.EMPTY_ATTRIBUTES); final Attributes newAttributes = oldAttributes.setAttribute(attributeDefinitions, this.templateMode, attributeDefinition, completeName, value, valueQuotes); return new OpenElementTag(this.templateMode, this.elementDefinition, this.elementCompleteName, newAttributes, this.synthetic, this.templateName, this.line, this.col); }
public boolean isOverflown() throws IOException { if (this.flushable) { // We need this flushing because OutputStreamWriter bufferizes, and given we might be taking account of // the output bytes at an OutputStream implementation in a level below this OutputStreamWriter, we could // have the wrong figures until we flush contents. this.flush(); this.flushable = false; } return this.adapter.isOverflown(); }
@Override public IStandaloneElementTag createStandaloneElementTag(final String elementName, final boolean synthetic, final boolean minimized) { final ElementDefinition elementDefinition = this.elementDefinitions.forName(this.templateMode, elementName); return new StandaloneElementTag(this.templateMode, elementDefinition, elementName, null, synthetic, minimized); }
public static boolean isInlineable(final IText text) { if (text == null) { return false; } if (text instanceof Text) { return ((Text) text).isInlineable(); } return computeInlineable(text); }
private IStandaloneElementTag removeAttribute(final IStandaloneElementTag standaloneElementTag, final String prefix, final String name) { if (!(standaloneElementTag instanceof StandaloneElementTag)) { return removeAttribute(StandaloneElementTag.asEngineStandaloneElementTag(standaloneElementTag), prefix, name); } return ((StandaloneElementTag) standaloneElementTag).removeAttribute(prefix, name); }
StandaloneElementTag removeAttribute(final AttributeName attributeName) { final Attributes oldAttributes = (this.attributes != null? this.attributes : Attributes.EMPTY_ATTRIBUTES); final Attributes newAttributes = oldAttributes.removeAttribute(attributeName); if (oldAttributes == newAttributes) { return this; } return new StandaloneElementTag(this.templateMode, this.elementDefinition, this.elementCompleteName, newAttributes, this.synthetic, this.minimized, this.templateName, this.line, this.col); }